<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title><!-- 停车场管理 -->
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@2.10/lib/index.css">  -->   
    <!-- <link rel="stylesheet" href="https://cdn.bootcss.com/element-ui/2.13.0/theme-chalk/index.css"> -->
    <script src="https://cdn.bootcss.com/vue/2.6.10/vue.min.js"></script>
    <!-- <script src="https://cdn.bootcss.com/element-ui/2.13.0/index.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vant@2.10/lib/vant.min.js"></script> -->
    <script src="https://cdn.bootcss.com/echarts/4.8.0/echarts.min.js"></script>
    <script>
        function getQueryPram (str,name){
          //获取？号出现几次
          var tempArr = str.split('?');

          // //如果大于1
          if(tempArr.length-1>1){
            var rt = null;
            for(var i in tempArr){
              var s = tempArr[i]
              var reg1 = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
              var r1 = s.match(reg1); //匹配目标参数
              if (r1 != null) {
                rt = decodeURIComponent(r1[2]);//一直覆盖，要最后的就行了
              }
            }

            return rt
          }
          var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
          if(!str.split("?")[1])return null;
          var r = str.split("?")[1].match(reg); //匹配目标参数

          if (r != null) {
            return decodeURIComponent(r[2]);

          }
          return null; //返回参数值

        }
        /* 
         *  环境变量配置
         *  'prod'  正式环境
         *  'dev'  测试环境
         *   'localhost'  车主本地调试环境  app.vue里需修改token和变量
         */
        let flag = 'dev'  // 'prod'  //   'localhost' //  

        //http://gzh1.52tingche.com/loading?appId=123
        const url=window.location.href;//获取当前地址栏
        const appIdVal = getQueryPram(url,'appId');
        let baseUrl = "",
            pageUrl = "",
            appID = "";            
        if(flag == 'prod'){
            baseUrl = "http://52tingche.com"
            pageUrl = "http://gzh.52tingche.com"
            appID = appIdVal;
        }else if(flag == 'dev'){
            baseUrl = "http://beta.52tingche.com" 
            pageUrl = "http://gzh1.52tingche.com"
            appID = appIdVal;
        } else if(flag == 'localhost'){
            baseUrl = "http://beta.52tingche.com" 
            pageUrl = "http://gzh1.52tingche.com"
            appID = appIdVal;
        }
        console.log(appID,"appID+init")
    </script>
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>
